<template>
  <section>
    <product-create :formData.sync="createForm" @cancelCreate="cancel" @okCreate="ok" />
  </section>
</template>

<script>
export default {
  components: {
            'product-create': () => import('../../components/Product/create'),
  },
  data() {
    return {
      createForm: {
          product_id: 0,
          is_alibaba: false,
          is_view: true,
      },
      from: ""
    };
  },
  mounted() {
  },
        created() {
            this.createForm.product_id = parseInt(this.$route.query.id);
            this.from = this.$route.query.from;
        },

  methods: {
    cancel() {
        // this.$router.push({path: '/company/vendors'});
    },
    ok() {
      if(this.from) {
        this.$router.push({name: this.from});
      } else {
        this.$router.push({path: '/goods_create'});
      }
    },
  }
};
</script>
